<?php

class TicketService {

	public  $dbutil;
	function __construct($dbutil){
		$this->dbutil =  $dbutil;
	}

	public  function updateEvent($data,$where){
		$this->dbutil->update("products",$data,$where);
	}
	public function countNum(){
		$sql = "select count(DEVICE_ID) countnum from TCA_RESOURCE_INFO";
    	$resutrnarry=	$this->dbutil->get_results($sql);
    	return $resutrnarry[0]->countnum;
	}
	public function ticketPage($start , $page_size ){
		$limit ="";
		if($page_size){
			$limit =" limit $start,$page_size ";
		}
		$sql = "select * from TCA_RESOURCE_INFO order by DEVICE_ID $limit";
		return $this->dbutil->get_results($sql);


	}
}

?>